package ch4;

import java.util.Scanner;

public class Max3 {

	public static void main(String[] args) {
		// 3个数，按照从小到大的顺序输出
		Scanner in = new Scanner(System.in);
		System.out.println("请输入三个数：");
		final int a = in.nextInt();
		final int b = in.nextInt();
		final int c = in.nextInt();

		// int max = a > b ? (b > c ? a : c) : (b < c ? c : b);
		// int mid = b < c ? (a < b ? b : c) : (a > b ? b : a);
		// int min = a < b ? (b < c ? a : c) : (b < c ? b : c);

		// System.out.println("min=" + min + "mid=" + mid + "max=" + max);

		if (a >= b && b >= c) {
			System.out.println(c + " " + b + " " + a);
		} else if (a >= c && c >= b) {
			System.out.println(b + " " + c + " " + a);
		} else if (b >= c && c >= a) {
			System.out.println(a + " " + c + " " + b);
		} else if (b >= a && a >= c) {
			System.out.println(c + " " + a + " " + b);
		} else if (c >= a && a >= b) {
			System.out.println(b + " " + a + " " + c);
		} else {
			System.out.println(a + " " + b + " " + c);
		}
	}

}
